import * as API from '../services/auth';

export default {
    state:{},
    reducers:{
        save( state,{payload} ){
            return {
                ...state,
                ...payload
            }
        }
    },
    effects:{
        *login( {payload}, {call} ){
           const result = yield call(API.loginReq, {...payload});
           return result.data;
        },
        *register( {payload}, {call} ){
            const result = yield call(API.registerReq, {...payload});
            return result.data;
        },
        *confirmName( {payload},{call} ){
            const result = yield call(API.confirmNameReq, {...payload});
            return result.data;
        }
    }
}
